package com.atguigu.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.gulimall.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.CategoryEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author luosheng
 * @email luoshengshuai@foxmail.com
 * @date 2023-02-25 15:43:24
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 查询所有分类数据并组装成树形结构
     */
    List<CategoryEntity> listWithTree();

    /**
     * 根据id集合删除菜单
     * @param asList
     */
    void removeMenuByIds(List<Long> asList);

    // 保存并判断
    void saveCategory(CategoryEntity category);

    // 更新并判断
    void updateCateGory(CategoryEntity category);

    /**
     * 获取到当前catelogId的整个path
     * @param catelogId
     * @return
     */
    Long[] findCatelogePath(Long catelogId);

    void updateByCascade(CategoryEntity category);
}

